import { post, get } from "../utils/request";

export const login = (params, isSilence=false) => {
  return post(getApp().globalData.bnUri + 'zfbapp/user/login ', params, isSilence);
}

export const getCreditScore = (params) => {
  return post(getApp().globalData.bnUri + 'zfbapp/user/credit/score ', params);
}

//   获取所以地区码
export const getArea = (params) => {
  return post(getApp().globalData.apiUrl + 'homePage/getArea ', params);
}

//   领券中心
export const getCouponCenterList = (params) => {
  return post(getApp().globalData.bnUri + 'coupon/available', params);
}

//   获取用户地址
export const getUserAddress = (params) => {
  return get(getApp().globalData.bnUri + 'user/address', params);
}

//   获取实名认证数据
export const getUserCertify = (params) => {
  return post(getApp().globalData.apiUrl + 'userCenter/getUserCertify', params);
}

//   获取个人所有优惠券
export const getUserCouponList = (params) => {
  return post(getApp().globalData.bnUri + 'coupon/list', params);
}

//   获取用户信息
export const getUserInfo = (params) => {
  // return post(getApp().globalData.apiUrl + 'userCenter/getUserInfo', params);
  return post(getApp().globalData.bnUri + 'user/get', params)
}
//   修改新增用户地址
export const setUserAddress = (params) => {
  return post(getApp().globalData.bnUri + 'user/address', params);
}

//产品建议
export const setUserIdea = (params) => {
  return post(getApp().globalData.apiUrl + 'userCenter/setUserIdea', params);
}

//保存用户信息
export const setUserPhone = (params) => {
  return post(getApp().globalData.bnUri + 'zfbapp/user/phone', params);
}

//领取优惠券
export const setUserCoupon  = (params) => {
  return post(getApp().globalData.bnUri + 'coupon/bind ', params);
}

export const getSignature = (params) => {
  return post(getApp().globalData.bnUri + 'oss/sign ', params);
}


